
package ControlLayer;
import ModelLayer.*;
import DBLayer.*;
import java.util.ArrayList;

/**
 *
 * @author Thomas
 */
public class CtrlCustomer 
{
    
    private Customer customer;
    private Club club;
    private PrivateCustomer privateCustomer;
    
    /**
     * Creates a new instance of CtrlCustomer
     */
    public CtrlCustomer()
    {
    
    }
    
    public ArrayList findAllEmployee()
    {
      IFDBCustomer dbCust = new DBCustomer();
      ArrayList allCustomers = new ArrayList();
      allCustomers = dbCust.getAllCustomers();
      return allCustomers;
    }
    
      public Customer findPerson(int customerId)
    {
        IFDBCustomer dbCust = new DBCustomer();
        return dbCust.findCustomer(customerId);
    }
      
    public Customer findCustomerFname(String fname)
    {
        IFDBCustomer dbCust = new DBCustomer();
        return dbCust.searchCustomerFname(fname);
    }
    
     public Customer findCustomerLname(String lname)
    {
        IFDBCustomer dbCust = new DBCustomer();
        return dbCust.searchCustomerLname(lname);
    }
     
     public void insertCustomer(Customer cust)
      {
           IFDBCustomer dbCust = new DBCustomer();
           dbCust.insertCustomer(cust);
      }
    
    
      public int updateCustomer(int customerId, String fname, String lname, String address, int zipCode, String city, String phoneNo, String email)
      {
          IFDBCustomer dbCust = new DBCustomer();
          Customer cust = new Customer();
          cust.setFname(fname);
          cust.setLname(lname);
          cust.setAddress(address);
          cust.setZipCode(zipCode);
          cust.setCity(city);
          cust.setPhoneNo(phoneNo);
          cust.setEmail(email);
          return  dbCust.updateCustomer(cust);
      }
      
      public void deleteCustomer(int customerId )
      {
          IFDBCustomer dbCust = new DBCustomer();
          dbCust.deleteCustomer(customerId);
          
          
      }

      
}
